// pages/message/index/index.ts
Page({
  data: {
    alertTitle: '',
    messageList: [
      {
        title: "收到新的分享",
        date: "2025-02-13",
        content: "13320974082分享了新的设备给您：语文百货·立平医院店通道1。",
        actionList: [],
        icon: 'share'
      },
      {
        title: "备货申请",
        date: "2025-02-13",
        content: "13320974082申请需要1台xx摄像头，请尽快处理。",
        actionList: [
          { id: 1, text: "已备" },
          { id: 2, text: "拒绝" }
        ]
      },
      {
        title: "工单提醒",
        date: "2025-02-13",
        content: "您的工单：前往万达广场的故障维修，还剩3天，请注意查看。",
        actionList: []
      },
      {
        title: "转办提醒",
        date: "2025-02-13",
        content: "徐某某：工单已转办，请前往万达广场的故障维修，还剩3天，请注意查看。",
        actionList: [
          { id: 1, text: "接受" },
          { id: 2, text: "拒绝" }
        ]
      },
      {
        title: "延期申请",
        date: "2025-02-13",
        content: "徐某某：工单已提交延期申请，前往万达广场的故障维修，延期3天，请注意查看。",
        actionList: [
          { id: 1, text: "同意" },
          { id: 2, text: "驳回" }
        ]
      },
      {
        title: "归还申请",
        date: "2025-02-13",
        content: "13320974082归还5台xx摄像头，请尽快核查。",
        actionList: [
          { id: 1, text: "确认" },
          { id: 2, text: "驳回" }
        ]
      }
    ]
  },
  showAlert(e) {
    const title = `是否${e.currentTarget.dataset.action.text}${e.currentTarget.dataset.title}`
    const alert = this.selectComponent('#v-alert')
    this.setData({
      alertTitle: title
    })
    alert.toggleAlert()
  },
  handleConfirm() {
    wx.showToast({
      title: '操作成功',
      icon: 'success',
      duration: 1500,
    })
  },
})